@extends('home.layout.home')
@section('title',$config->title)

@section('nav')
            <div class="shopNav">
                <div class="slideall">
                    
                       <div class="long-title"><span class="all-goods">全部分类</span></div>
                       <div class="nav-cont">
                            <ul>

                                <li class="index"><a href="/">首页</a></li>
                                @foreach($cates as $v)
                                    @if($v->pid =='0')
                                    <li class="qc"><a href="/list/?cid={{$v->id}}">{{$v->name}}</a></li>
                                    @endif                            
                                @endforeach                             

                                <!-- <li class="qc last"><a href="#">大包装</a></li> -->
                            </ul>
                            <div class="nav-extra">
                                <a href="/apply/index">
                                    <i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>商家入驻
                                    <i class="am-icon-angle-right" style="padding-left: 10px;"></i>
                                </a>    
                            </div>
                        </div>                  
                                
                        <!--侧边导航 -->
                        <div id="nav" class="navfull">
                            <div class="area clearfix">
                                <div class="category-content" id="guide_2">
                                    
                                    <div class="category">
                                        <ul class="category-list" id="js_climit_li">
                                        
                                            @foreach($cates as $k=>$v)
                                            <li class="appliance js_toggle relative">
                                                <div class="category-info">
                                                    <h3 class="category-name b-category-name"><i><img src="/home/images/cake.png"></i><a class="ml-22">{{$v->name}}</a></h3>
                                                    <em>&gt;</em></div>
                                                <div class="menu-item menu-in top">
                                                    <div class="area-in">
                                                        <div class="area-bg">
                                                            <div class="menu-srot">
                                                                <div class="sort-side">
                                                                    @foreach($v->sub_cate as $kk=>$vv)
                                                                    <dl class="dl-sort">
                                                                        <dt>
                                                                            <span><a href="/list/?cid={{$vv->id}}">{{$vv->name}}</a></span>
                                                                        </dt>
                                                                        @foreach($vv->sub_cate as $kkk=>$vvv)
                                                                            <dd>
                                                                                <a href="/list/?cid={{$vvv->id}}">
                                                                                    <span>{{$vvv->name}}</span>
                                                                                </a>
                                                                            </dd>
                                                                        @endforeach
                                                                        
                                                                    </dl>
                                                                    @endforeach 
                                                                    
                                                                </div>

                                                                <!-- <div class="brand-side">
                                                                    <dl class="dl-sort"><dt><span>实力商家</span></dt>
                                                                        <dd><a rel="nofollow" title="呵官方旗舰店" target="_blank" href="#" rel="nofollow"><span  class="red" >呵官方旗舰店</span></a></dd>
                                                                        <dd><a rel="nofollow" title="格瑞旗舰店" target="_blank" href="#" rel="nofollow"><span >格瑞旗舰店</span></a></dd>
                                                                        <dd><a rel="nofollow" title="飞彦大厂直供" target="_blank" href="#" rel="nofollow"><span  class="red" >飞彦大厂直供</span></a></dd>
                                                                        <dd><a rel="nofollow" title="红e·艾菲妮" target="_blank" href="#" rel="nofollow"><span >红e·艾菲妮</span></a></dd>
                                                                        <dd><a rel="nofollow" title="本真旗舰店" target="_blank" href="#" rel="nofollow"><span  class="red" >本真旗舰店</span></a></dd>
                                                                        <dd><a rel="nofollow" title="杭派女装批发网" target="_blank" href="#" rel="nofollow"><span  class="red" >杭派女装批发网</span></a></dd>
                                                                    </dl>
                                                                </div> -->

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            <b class="arrow"></b>   
                                            </li>                                           
                                            @endforeach
                                            
                                            
                                        </ul>
                                    </div>
                                </div>

                            </div>
                        </div>
                        
                        
                        <!--轮播-->
                        
                        <script type="text/javascript">
                            (function() {
                                $('.am-slider').flexslider();
                            });
                            $(document).ready(function() {
                                $("li").hover(function() {
                                    $(".category-content .category-list li.first .menu-in").css("display", "none");
                                    $(".category-content .category-list li.first").removeClass("hover");
                                    $(this).addClass("hover");
                                    $(this).children("div.menu-in").css("display", "block")
                                }, function() {
                                    $(this).removeClass("hover")
                                    $(this).children("div.menu-in").css("display", "none")
                                });
                            })
                        </script>



                    <!--小导航 -->
                    <div class="am-g am-g-fixed smallnav">
                        <div class="am-u-sm-3">
                            <a href="sort.html"><img src="/home/images/navsmall.jpg" />
                                <div class="title">商品分类</div>
                            </a>
                        </div>
                        <div class="am-u-sm-3">
                            <a href="#"><img src="/home/images/huismall.jpg" />
                                <div class="title">大聚惠</div>
                            </a>
                        </div>
                        <div class="am-u-sm-3">
                            <a href="#"><img src="/home/images/mansmall.jpg" />
                                <div class="title">个人中心</div>
                            </a>
                        </div>
                        <div class="am-u-sm-3">
                            <a href="#"><img src="/home/images/moneysmall.jpg" />
                                <div class="title">投资理财</div>
                            </a>
                        </div>
                    </div>


                    <div class="clear"></div>
                </div>
                <script type="text/javascript">
                    if ($(window).width() < 640) {
                        function autoScroll(obj) {
                            $(obj).find("ul").animate({
                                marginTop: "-39px"
                            }, 500, function() {
                                $(this).css({
                                    marginTop: "0px"
                                }).find("li:first").appendTo(this);
                            })
                        }
                        $(function() {
                            setInterval('autoScroll(".demo")', 3000);
                        })
                    }
                </script>
            </div>
@endsection     


@section('content')

    <div class="shopMain" id="shopmain">
        <!--今日推荐 -->
        <div class="am-g am-g-fixed recommendation">
            <div class="clock am-u-sm-3" >
            	<img src="/home/images/2016.png "></img>
				<p>今日<br>推荐</p>
			</div>

						@foreach($today as $k => $v)				
						<div class="am-u-sm-4 am-u-lg-3 ">
							<div class="info ">
								<h3>{{$v->spname}}</h3>
								<h4>￥ {{$v->price}} 元</h4>
							</div>
							<div class="recommendationMain two ">
								<a href="/detail/{{$v->id}}"><img src="{{$v->cover}}" width="120" height="120" /></a>
							</div>
						</div>
						@endforeach

					</div>
					<div class="clear "></div>


@foreach($cates as $k=>$v)
	    <div id="f{{$k+1}}">
	        <!--甜点-->
	        <div class="am-container ">
	            <div class="shopTitle ">
	                <h4>{{$k+1}}F {{$v->name}}</h4>
	                <!-- <h3>每一道甜品都有一个故事</h3> -->
	               
	                <span class="more ">
	                    <a href="/list/?cid={{$v->id}}">
	                    	查看更多<i class="am-icon-angle-right" style="padding-left:10px ;" ></i>
	                    </a>	                        
	                </span>

	            </div>
	        </div>
	        <div class="am-g am-g-fixed floodFour">
	            <div class="am-u-sm-5 am-u-md-4 text-one list ">
	                <div class="word">
					@foreach($v->sub_cate as $kk=>$vv)
	                    <a class="outer" href="/list/?cid={{$v->id}}"><span class="inner"><b class="text">{{$vv->name}}</b></span></a>
	                @endforeach 
	                </div>
					
					

	                <!-- <a href="/">
	                    <div class="outer-con ">
	                        <div class="title ">
	                            abc
	                        </div>
	                        <div class="sub-title ">
	                            abc
	                        </div>
	                    </div>
	                    <img src="/home/images/act1.png " />
	                </a> -->

	                <div class="triangle-topright"></div>
	            </div>
				
			<?php
				$cid = $v->id;
				$n = DB::table('cates')->where('path','like',"%,{$cid}%")->orwhere('id',$cid)->lists('id');

        		$goods = DB::table('goods')->where('status','1')->wherein('cate',$n)->paginate(8);
				//$goods = DB::table('goods')->where()->orderBy('id','desc')->paginate(8);
			?>

	            @foreach($goods as $k => $v)
				<div class="am-u-sm-7 am-u-md-4 text-two ">
					<div class="outer-con ">
						<div class="title ">
							{{$v->spname}}
						</div>									
						<div class="sub-title ">
							¥{{$v->price}}
						</div>
						<a href="/join/{{$v->id}}" class="am-icon-shopping-basket am-icon-md seprate "></a>
					</div>
					<a href="/detail/{{$v->id}}">
						<img src="{{$v->cover}}" width="180" height="180" />
					</a>
            	</div>
            	@endforeach

	            
	        </div>
	        <div class="clear "></div>
	    </div>
@endforeach



	    <div class="footer ">
	        <div class="footer-hd ">
	            <p>友情连接:
	            @foreach($links as $k=>$v)
	                <a href="{{$v->url}}" target="_blank">{{$v->name}}</a>
	                <b>|</b>
	            @endforeach  
	            </p>
	        </div>
	        <div class="footer-bd ">
	            <p>
	                <a href="/">返回首页</a>
	                
	                <em>© 2017-2027 179php.com 版权所有</em>
	            </p>
	        </div>
	    </div>
	</div>

@endsection